#include"process.h"

typedef void (*flush_t)(double,double);

const int base = 5000 ;
double total = 2028.0;
double once = 0.1;

void download(flush_t f)
{
  int r = rand() % base + 1;
  
  double speed = r * once;
  double current = 0.0;
  while(current < total)
  {
    current += speed;
    if(current >= total)
    {
      current = total;
      f(total,current);
    } 

    f(total,current);
  }
  printf("\n");
}

int main()
{
  srand(time(0));
  download(process);  

  return 0;
}
